import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'


const urlConfig = {
  '待申请服务企业列表查询':{ url: '/ent/info/queryApplyEntList', method:'post'},// parentId
  '创建银行开户':{ url: '/openBank/createOpenBank', method:'post'},// parentId
  '订单列表':{ url: '/qsb/order/list', method:'post'},// parentId
  '根据企业id查询企业的当前状态':{ url: '/ent/getEntStatus', method:'get'},// parentId
  '获取税务变更信息':{ url: '/taxbiz/queryTaxInfo', method:'get'},// parentId
  '税务变更信息提交':{ url: '/taxbiz/taxInfoSub', method:'post'},// parentId
  '获取经营范围列表': { url: '/ent/regist/queryManageNature', method: 'get' }, // parentId
  '企业服务列表-数量': { url: '/qsb/order/count', method: 'post' }, //
  '企业端发起企业注销': { url: '/ent/deregister/webAdd', method: 'post' }, //
  '工商注册变更信息提交': { url: '/rechangebiz/registChangeSub', method: 'post' }, //
  '变更前详情查询': { url: '/rechangebiz/queryDetailPre', method: 'get' }, //v
  '获取所有BusinessType数据': { url: '/qsb/order/allBusinessType', method: 'post' }, //v
  '获取所有Subitem数据': { url: '/qsb/order/allSubitem', method: 'post' }, //v
  '增值业务配置-列表': { url: '/qsb/valueAddedService/entFilter/list', method: 'post' }, //v
  '增值业务订单提交': { url: '/addbiz/addServiceSub', method: 'post' }, //v
  '判断企业是否可以税务变更': { url: '/taxbiz/taxSubCheck', method: 'get' }, //entId


  // '获取税务变更信息':{ url: '/qsb/taxbiz/queryTaxInfo', method:'get'},// parentId
  // '税务变更信息提交':{ url: '/qsb/taxbiz/taxInfoSub', method:'post'},// parentId
}

const actionType = {
  get: (url,parameter)=>{
    return getAction(url,parameter)
  },
  post:(url,parameter)=>{
    return postAction(url,parameter)
  },
  put:(url,parameter)=>{
    return putAction(url,parameter)
  },
  delete:(...args)=>{
    return deleteAction(...args)
  },
  http:(url,parameter,method)=>{
    return httpAction(url,parameter,method)
  },
}

export default (key,...args) =>{
  const tempConfig = urlConfig[key]
  return actionType[tempConfig.method](tempConfig.url,...args)
}

